package bubbleSort;

import shared.Buffer;

/**
 *	The SorterStarted class is a state of a BubbleSorter that represents that another sorter has been started.
 */
public class SorterStarted<T extends Comparable<? super T>> extends BubbleSorterState<T>{
	private final BubbleSorter<T> otherSorter;

	public BubbleSorter<T> getOtherSorter() {
		return otherSorter;
	}
	
	public SorterStarted(final BubbleSorter<T> thisSorter, final BubbleSorter<T> otherSorter) {
		super(thisSorter);
		this.otherSorter = otherSorter;
	}


	@Override
	public void accept(final BubbleSorterStateVisitor<T> visitor) {
		visitor.visit(this);
	}

	@Override
	public Buffer<T> getResult() {
		return otherSorter.getResult();
	}
}
